package com.newsanalysis.service;

import com.newsanalysis.model.entity.News;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;
import java.util.Map;
import java.util.Optional;

public interface NewsService {
    
    News save(News news);
    
    Optional<News> findById(Long id);
    
    Page<News> findAll(Pageable pageable);
    
    Page<News> findByCategory(String category, Pageable pageable);
    
    Page<News> searchByKeyword(String keyword, Pageable pageable);
    
    boolean updateNews(News news);
    
    boolean deleteById(Long id);
    
    int batchSave(List<News> newsList);
    
    List<News> findTopHotNews(int limit);
    
    Map<String, Long> getCategoryDistribution();
    
    Map<String, Long> getSentimentDistribution();
}

